package com.placement.refresh.batch;

import org.apache.log4j.xml.DOMConfigurator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.placement.refresh.service.RefreshBatchService;
import com.placement.refresh.util.RefreshProperites;

/**
 *	purpose: This class abstract class to run the different modules for batch process.
 *
 * 	Amit Chadha
 *
 */
public abstract class RefreshDataProcess {
	private RefreshBatchService refreshBatchService;
	
	/**
	 *	purpose: load Spring framework configuration. 
	 */
	public final static ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
	 
	 /**
	  *	purpose: load logging configuration. 
	  */
	public RefreshDataProcess(){
		 String propValue = RefreshProperites.getProperty("LOG4j_CONF_FILE");
		 DOMConfigurator.configure(propValue); 
	 }

	public RefreshBatchService getRefreshBatchService() {
		return refreshBatchService;
	}

	public void setRefreshBatchService(RefreshBatchService refreshBatchService) {
		this.refreshBatchService = refreshBatchService;
	}
	
	/**
	 * purpose: This method starts batch process
	 *  
	 */
	public abstract void startBatch();


	
}
